<?php

class Uploader
{
	protected $file;
	protected $target_directory;
	
	public function __construct ($raw_file = NULL)
	{
		$this->file = $raw_file;
	}
	
	public function upload ()
	{
		if (file_exists($this->file)) {
			move_uploaded_file($this->file, $this->target_directory);
		}
	}
}

$uploader = new Uploader('my-photo.jpg');

$uploader->upload(array(
	'success' => array(function () {
		// success callback
	}),
	'error' => array(function () {
		// error callback
	})
));
	
	// its ok